home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / quicktime vr / vrscript / feature files / vrsound.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  3.5 KB  |  80 lines

  1. //////////
  2. //
  3. //    File:        VRSound.h
  4. //
  5. //    Contains:    Sound support for QuickTime VR movies.
  6. //
  7. //    Written by:    Tim Monroe
  8. //
  9. //    Copyright:    © 1996-1997 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //    Change History (most recent first):
  12. //
  13. //       <3>         03/13/98    rtm        removed for chunk-based sound files (AIFF and WAVE)
  14. //       <2>         08/11/97    rtm        added support for chunk-based sound files (AIFF and WAVE)
  15. //       <1>         12/09/96    rtm        first file
  16. //       
  17. //////////
  18.  
  19. #pragma once
  20.  
  21. // header files
  22. #include <math.h>
  23. #include <Endian.h>
  24.  
  25. #include "ComApplication.h"
  26.  
  27. #if TARGET_OS_MAC
  28. #include "MacFramework.h"
  29. #endif
  30.  
  31. #if TARGET_OS_WIN32
  32. #include "WinFramework.h"
  33. #endif
  34.  
  35. #include "VRScript.h"
  36.  
  37. // constants
  38.  
  39. // values that we pass in param1 of a callBackCmd
  40. enum {
  41.     kVRSound_Complete    = 1                // the sound has finished playing
  42. };
  43.  
  44. #define kVRSound_NumFadeSteps    8        // number of steps while fading a sound to silence
  45. #define kVRSound_FadeStepWait    5        // number of ticks to wait on each fade step
  46. #define kVRSound_NumCmdsInQueue    4        // number of commands in a sound channel queue
  47. #define kVRSound_SpeakerAngle    15.0    // angular distance (in degrees) of left or right speaker from viewer vector
  48.  
  49.  
  50. // function prototypes
  51. Boolean                        VRSound_CheckVersionNumber (const NumVersion *theVersion, UInt8 theMajor, UInt8 theMinor, UInt8 theBug);
  52. SoundHeaderPtr                VRSound_GetSoundHeader (Handle theSndHandle);
  53. long                        VRSound_GetSndBaseFrequency (Handle theSndHandle);
  54. OSErr                        VRSound_GetVolume (SndChannelPtr theChannel, unsigned short *theLeftVol, unsigned short *theRightVol);
  55. OSErr                        VRSound_SetVolume (SndChannelPtr theChannel, unsigned short theLeftVol, unsigned short theRightVol);
  56. SndChannelPtr                VRSound_CreateSoundChannel (Boolean theSoundIsLocalized);
  57. SSpSourceReference            VRSound_CreateLocalizedSource (void);
  58. void                        VRSound_SetLocation (WindowObject theWindowObject, UInt32 theEntryID, float theX, float theY, float theZ, UInt32 theOptions);
  59. short                        VRSound_GetSndResourceID (short theRefNum);
  60. void                        VRSound_Update3DSoundEnv (WindowObject theWindowObject);
  61. void                        VRSound_SetBalanceAndVolume (WindowObject theWindowObject, float thePan, float theTilt);
  62. void                        VRSound_Init (void);
  63. void                        VRSound_Stop (void);
  64. void                        VRSound_InitWindowData (WindowObject theWindowObject);
  65. void                        VRSound_DumpWindowData (WindowObject theWindowObject);
  66. void                        VRSound_FadeNodeSounds (WindowObject theWindowObject);
  67. void                        VRSound_DumpNodeSounds (WindowObject theWindowObject);
  68. void                        VRSound_DumpSceneSounds (WindowObject theWindowObject);
  69. void                        VRSound_DumpSelectedSounds (WindowObject theWindowObject, UInt32 theOptions);
  70. void                        VRSound_FadeSilence (WindowObject theWindowObject, SndChannelPtr theChannel);
  71. void                        VRSound_PlaySilence (WindowObject theWindowObject, SndChannelPtr theChannel);
  72. void                        VRSound_PlayResource (WindowObject theWindowObject, SndChannelPtr theChannel, SndListHandle theResHandle, UInt32 theOptions);
  73. void                        VRSound_PlaySound (WindowObject theWindowObject, UInt32 theNodeID, UInt32 theResID, UInt32 theEntryID, float theX, float theY, float theZ, float theProjAngle, UInt32 theSourceMode, UInt32 theMode, UInt32 theFade, UInt32 theOptions);
  74. void                        VRSound_InstallCallbackMessage (VRScriptSoundPtr theEntry, short theMessage);
  75. VRScriptSoundPtr            VRSound_GetFinishedSound (WindowObject theWindowObject);
  76. PASCAL_RTN void                VRSound_CallbackProc (SndChannelPtr theChannel, SndCommand *theCommand);
  77. void                        VRSound_CheckForCompletedSounds (WindowObject theWindowObject);
  78. void                        VRSound_DumpEntryMem (VRScriptSoundPtr theEntry);
  79.  
  80.